Conversation
Jgrasp
marked this pull request as draft
July 28, 2026 12:49
Jgrasp
commented
Jul 28, 2026
| use Symfony\Component\Console\Style\SymfonyStyle; | ||
| use Symfony\Contracts\Translation\TranslatorInterface; | ||
|
|
||
| #[AsCommand(name: 'sherlockode:sylius-acb:init-scope', description: 'Initialize Sylius scopes for ACB')] |
Contributor
Author
There was a problem hiding this comment.
On est dans un plugin. Pas d'attribute, mettre la déclaration dans un fichier xml propre.
| sherlockode_sylius_acb_admin_scope_init: | ||
| path: "/scope/init" | ||
| defaults: | ||
| _controller: sherlockode_sylius_acb.controller.scope::updateScopesAction |
Contributor
Author
There was a problem hiding this comment.
sherlockode_sylius_acb.controller.scope pourquoi on ne peut plus utiliser ça ? Normalement c'est toujours disponible.
| sherlockode_sylius_acb_admin_page_preview: | ||
| path: "/preview/{pageIdentifier}" | ||
| defaults: | ||
| _controller: sherlockode_sylius_acb.controller.preview::previewAction |
| blocks: | ||
| sylius_acb: | ||
| template: "@SherlockodeSyliusAdvancedContentPlugin/admin/stylesheets.html.twig" | ||
| # sylius_ui.events was removed in Sylius 2.x (replaced by Twig UX hooks). |
Contributor
Author
There was a problem hiding this comment.
Supprime les commentaires
| tags: | ||
| - { name: container.service_subscriber } | ||
|
|
||
| # FQCN aliases: admin_routing.yaml référence ces contrôleurs par leur FQCN |
| # FQCN aliases: admin_routing.yaml référence ces contrôleurs par leur FQCN | ||
| # (_controller: ...\PreviewController::previewAction). Le resolver Symfony cherche | ||
| # un service dont l'id == FQCN ; sans cet alias il tente un new() sans DI → "not in container". | ||
| Sherlockode\SyliusAdvancedContentPlugin\Controller\PreviewController: |
Contributor
Author
There was a problem hiding this comment.
Normalement pas besoin car c'est un resource controller. Donc l'alias est mis automatiquement. Si ça fonctionnne pas c'est pas normal
The plugin did not boot on Sylius 2: the resource component namespaces moved, the resource and routing configuration formats changed, and the admin UI switched from Semantic UI to Bootstrap 5 / Tabler, so every template shipped by the plugin rendered unstyled or broken. Requirements move to php ^8.2, sylius/sylius ^2.0 and symfony ^7.4. This drops support for Sylius 1.x, PHP 7.4 and PHP 8.1, and warrants a new major release line rather than a patch on the current one. Foundation - declare(strict_types=1) across src/ - resource namespaces: Sylius\Component\Resource\* -> Sylius\Resource\* - constructor property promotion and native types on controllers and listeners, redundant phpdoc removed Configuration - sylius_resource.yaml: form dropped from classes, removed in Sylius 2; ContentRepository registered on the content resource so the admin contents grid gets the createListQueryBuilder() it was missing - admin_routing.yaml: @SyliusAdmin/shared/crud templates, form moved to the route level - ScopeInitCommand declared in a dedicated commands.xml Admin templates, Semantic UI to Bootstrap 5 / Tabler - Page and Content forms, preview and tools pages rebuilt on BS5 grids, cards and accordions, form context resolved through hookable_metadata - tabs driven by the BS5 data API, no jQuery call left - form themes: @SyliusUi/Form/theme -> @SyliusAdmin/shared/form_theme - status badges use Tabler variants - acb-notification.js uses a native BS5 modal, with a new admin/_confirmation_modal.html.twig and a window.confirm() fallback when the markup is not rendered - admin/stylesheets.html.twig removed: it only pulled the jQuery UI CSS from an external CDN, and the sylius_ui block that injected it no longer exists in Sylius 2 Bug fixes surfaced along the way - Doctrine ORM 3 TypeError on scoped modals. getByScopeQueryBuilder() passed a bare PHP array to QueryBuilder::setParameters(), which ORM 3 rejects. The exception was thrown before any Twig rendering, so every scoped content modal returned a guaranteed HTTP 500 as soon as the scope was resolved, and scopes are enabled by default. Replaced with successive setParameter() calls, valid under both ORM 2 and 3. PageRepository carried the same latent defect and was fixed too. - Inert Gedmo traits on Page. Since the annotations to XML conversion, the XML driver never inspected the attributes carried by the TimestampableEntity and BlameableEntity traits, leaving created_at, updated_at, created_by and updated_by unmapped: migrations:diff wanted to drop them and timestampable stopped being maintained. The four fields are now declared explicitly with gedmo:timestampable and gedmo:blameable tags, the way Sylius core does for XML-mapped entities.
BrownSim
reviewed
Jul 28, 2026
| {% for code, name in channels %} | ||
| {% if channels|length > 1 %} | ||
| <h5>{{ name }}</h5> | ||
| <h6 class="mb-2">{{ name }}</h6> |
Contributor
There was a problem hiding this comment.
Ici on change (pas bcp) le style
BrownSim
reviewed
Jul 28, 2026
sophie-mulard
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The plugin did not boot on Sylius 2. The resource component namespaces moved, the resource and routing configuration formats changed, and the admin UI switched from Semantic UI to Bootstrap 5 / Tabler — so every template shipped by the plugin rendered unstyled or broken.
This PR ports the whole plugin to Sylius 2 / Symfony 7.4 / PHP 8.2.
php^7.4 || ^8.1^8.2sylius/sylius^1.10^2.0symfony/*^7.4Foundation
declare(strict_types=1)across all ofsrc/Sylius\Component\Resource\*→Sylius\Resource\*(Model\ResourceInterface,Factory\FactoryInterface,Doctrine\Persistence\RepositoryInterface), FQCNs resolved againstsylius/resource2.2Configuration
sylius_resource.yaml: droppedformfromclasses(removed in Sylius 2), and registeredContentRepositoryon thecontentresource — the admin contents grid needscreateListQueryBuilder(), which was missing and producedcreateListQueryBuilder undefinedon/admin/acb/contents/admin_routing.yaml:@SyliusAdmin/shared/crudtemplates,formmoved to the route level. The two custom controllers keep being referenced by their service id (sherlockode_sylius_acb.controller.scopeand.preview); both services are declaredpublic: true, soContainerControllerResolverresolves them as-is and no FQCN alias is neededScopeInitCommandis declared in a dedicatedcommands.xml, imported byconfig.yamlPHP modernisation
PreviewController,ScopeController,AdminVersionListener,AdminGridListener: constructor property promotion, native types, redundant phpdoc removedScopeInitCommand:execute(): int. The command name and description stay inconfigure()rather than in an attribute — a plugin cannot presume that the host application autoconfigures its services, and the service is already taggedconsole.commandAdmin templates (Semantic UI → Bootstrap 5 / Tabler)
Page/_form,Content/_form,Page/_preview: BS5 grids, cards and accordions; form context resolved throughhookable_metadatanav-tabsdriven by the BS5 data API — the jQuery.tab()call is gone, no JS neededclasses/collapsemacros: Semantic UI utility classes → BS5 / Tablertools.html.twig: BS5 cards,bodyblock and the Sylius 2 admin layout@SyliusUi/Form/theme→@SyliusAdmin/shared/form_themebg-*-lt)acb-notification.js: native BS5 modal replacing Semantic UI + the jQuery global (both absent from Sylius 2), with a newadmin/_confirmation_modal.html.twigtemplate and awindow.confirm()fallback when the markup is not renderedadmin/stylesheets.html.twigremoved: it only pulled the jQuery UI CSS from an external CDN, and thesylius_uiblock that injected it on the four admin screens no longer exists in Sylius 2. Nothing referenced the template any more. Thejquery-uisortable JS the builder relies on stays bundled by the applicationBug fixes surfaced along the way
Doctrine ORM 3
TypeErroron scoped modals.getByScopeQueryBuilder()passed a bare PHP array toQueryBuilder::setParameters(), which ORM 3 rejects (it requires anArrayCollection). The exception was thrown before any Twig rendering, so every scoped ACB modal (acb_content_modal) returned a guaranteed HTTP 500 as soon as the scope was resolved — andscopes.enabledis hardcoded totruebySherlockodeSyliusAdvancedContentExtension, making it systematic in production. Replaced with two successivesetParameter()calls, a form valid under both ORM 2 and 3.PageRepositorycarried the same latent defect (not reachable today, since regular ACB page scopes are alwaysnull) and was fixed in the same pass.Inert Gedmo traits on
Page. Since the annotations → XML conversion in v0.4.0, theTimestampableEntity/BlameableEntitytraits had no effect: the XML driver does not inspect PHP attributes on traits.Page.orm.xmlimported thegedmonamespace without ever using it, socreated_at/updated_at/created_by/updated_bywere unmapped —doctrine:migrations:diffwanted to DROP them and timestampable stopped being maintained. The four fields are now declared explicitly with<gedmo:timestampable>/<gedmo:blameable>tags, the way Sylius core does for its XML-mapped entities. Types match the existing schema (created_at/updated_atdatetime NOT NULL,created_by/updated_bystring(255) nullable).Breaking change
This branch targets Sylius 2 exclusively — it drops support for Sylius 1.x, PHP 7.4 and PHP 8.1. It warrants a new major (or
2.x) release line rather than a patch on the current one.Verification
The two bug fixes above were found and fixed during manual QA on a Sylius 2 application, which is also how the routing, resource and controller wiring was exercised (contents and pages grids, page and content forms, preview, tools page, scoped content modals).
The command registration and controller wiring were re-checked on that application after the review round:
bin/console liststill exposessherlockode:sylius-acb:init-scopewithout the attribute, the command runs,router:match /admin/acb/scope/initresolvessherlockode_sylius_acb.controller.scope::updateScopesAction(), andlint:containerpasses.No automated test suite covers these paths in the plugin, so reviewers should keep in mind:
Pagemapping is runningdoctrine:migrations:diffon a Sylius 2 application and checking the diff comes out empty